package spil;

public class Konto {
	private int balance;
	
	public Konto() {
		balance = 1000;
	}
	
	public void setBalance(int balance) {
		this.balance = balance;
		if(this.balance < 0)
			this.balance = 0;
	}
	
	public int getBalance() {
		return balance;
	}
	
	public void insert(int penge) {
		balance += penge;
	}
	
	public void withdraw(int penge) {
		balance -= penge;
		if(balance < 0)
			balance = 0;
	}
	
	public String toString() {
		return "" + balance;
	}
}
